import { IsString, IsEmail, IsOptional, IsNotEmpty, MaxLength, MinLength } from 'class-validator';

/**
 * 创建用户DTO
 * 使用标准NestJS验证装饰器
 * 多语言错误消息通过LanguageService提供
 */
export class CreateUserDto {
  @IsString()
  @IsNotEmpty()
  @MaxLength(15)
  username: string;

  @IsString()
  @IsNotEmpty()
  @MinLength(6)
  @MaxLength(20)
  password: string;

  @IsString()
  @IsNotEmpty()
  @MaxLength(50)
  real_name: string;

  @IsEmail()
  @IsOptional()
  email?: string;

  @IsString()
  @IsOptional()
  @MaxLength(11)
  mobile?: string;
}
